< previous page page_144 next page >

Page 144
e10a6a0a59f035e870d90cca05b85fce.gif
        MsgBox "Error " & Format$(Err.Number) & _
            " selecting printer." & vbCrLf & _
            Err.Description
        Exit Sub
    End If
    On Error GoTo 0

    ' Print to the newly selected Printer object.
    Printer.Print "Selected printer: " & Printer.DeviceName
    Printer.EndDoc
End Sub
Unfortunately, the Common Dialog Control's printer selection capabilities vary greatly with different combinations of printer, device driver, operating system, and Visual Basic version. You may need to use some trial and error to determine which capabilities work for you.
Printer Properties
The Printer object has several attributes that you should understand to get the most out of your printer. Several of the most useful properties for controlling printer characteristics are listed below. The exact effects of many of these properties depend on your physical printer and the printer's device driver.
ColorMode. Determines whether a color printer prints in color or monochrome. ColorMode can have these values:
e10a6a0a59f035e870d90cca05b85fce.gif
vbPRCMMonochrome. Output is printed in monochrome.
e10a6a0a59f035e870d90cca05b85fce.gif
vbPRCMColor. Output is printed in color.
Copies. The number of copies to be printed. On many printers, it is faster to allow the printer to print multiple copies than to send the same output to the printer several times.
Duplex. For printers that can do two-sided printing, Duplex determines whether pages are printed on both sides. This property can have these values:
e10a6a0a59f035e870d90cca05b85fce.gif
vbPRDPSimplex. Single-sided printing.
e10a6a0a59f035e870d90cca05b85fce.gif
vbPRDPHorizontal. Double-sided printing with horizontal page turn.
e10a6a0a59f035e870d90cca05b85fce.gif
vbPRDPVertical. Double-sided printing with vertical page turn.
FontCount. Returns the number of fonts available on the printer.
Fonts. Lists the fonts available on the printer.
Height. Sets the height of the paper. You can use Height and Width instead of one of the predefined values for PaperSize.
Orientation. Determines the paper orientation. Orientation can have the values:
e10a6a0a59f035e870d90cca05b85fce.gif
vbPRORPortrait. The top of the page is along the short edge of the paper (normal).

 
< previous page page_144 next page >